package application;

import static implementations.Values.undirectedEdge;
import static implementations.Values.undirectedGraph;
import static implementations.Values.vertex;
import interfaces.Edge;
import interfaces.Graph;
import interfaces.Vertex;

public class GkaAufgabe1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Vertex<String> v1 = vertex("v1");
		Vertex<String> v2 = vertex("v2");
		Vertex<String> v3 = vertex("v3");
		Vertex<String> v4 = vertex("v4");
		Vertex<String> v5 = vertex("v5");
		
		Edge<String,String> e1 = undirectedEdge("e1", v1,v2);
		Edge<String,String> e2 = undirectedEdge("e2", v2,v3);
		Edge<String,String> e3 = undirectedEdge("e3", v2,v2);
		Edge<String,String> e4 = undirectedEdge("e4", v3,v4);
		Edge<String,String> e5 = undirectedEdge("e5", v3,v5);
		
		Graph<String,String> g1 = undirectedGraph(v1);
		g1.add(e1);
		g1.add(e2);
		g1.add(e3);
		g1.add(e4);
		g1.add(e5);
		int zugrVorher = g1.numberOfAccesses();
		System.out.println("Anzahl der Zugriffe fuer die Erstellung des Graphen: " + zugrVorher);
		System.out.println();
		System.out.println("Ausgabe Graph: ");
		System.out.println();
		System.out.println(g1.toString());
		System.out.println();
		System.out.println("Anzahl der ben�tigten Zugriffe fuers Traversieren: " + (g1.numberOfAccesses() - zugrVorher));

	}

}
